/**
 * Created by TAO on 2020/04/15 13:49.
 */
import http from '@/plugin/axios'
import jsonp from '@/plugin/jsonp'

export function login (data) {
  const url = '/Admin/Login/login'
  return http({ url, method: 'post', data, baseURL: '' })
}

export function logout () {
  const url = '/Admin/Login/unlogin'
  return http({ url, method: 'post', baseURL: '' })
}

export function resetPassword ({ oldpass, password }) {
  const url = '/Admin/User/user_list'
  return http.post(url, { oldpass, password }, { baseURL: '' })
}

// 获取每日一句
export function getDailyWord () {
  const url = 'http://open.iciba.com/dsapi'
  return jsonp(url)
}

export function getUploadToken () {
  const url = '/Admin/File/qiniuToken'
  return http({ url, method: 'post', baseURL: '' })
  // return http.post(url)
}
